﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp2
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = Convert.ToInt32(Console.ReadLine());
            int[,] a = new int[n, n];
            for (int i = 0; i < n; i++)
            {
                string[] row = Console.ReadLine().Split();
                for (int j = 0; j < n; j++)
                {
                    a[i, j] = Convert.ToInt32(row[j]);
                }
            }
            int f = 0;
            for (int i = 0; i < n; i++)
            {
                int temp = a[i, 0];
                int l = 0;
                for (int j = 1; j < n; j++)
                {
                    if (temp < a[i, j])
                    {
                        temp = a[i, j];
                        l = j;
                    }
                }
                int h = 0;
                for (; h < n; h++)
                {
                    if (temp > a[h, l])
                    {
                        break;
                    }
                }
                if (h == n)
                {
                    Console.WriteLine(temp + " " + i + " " + l);
                    f = 1;
                    break;
                }
            }
            if (f == 0)
            {
                Console.WriteLine("NONE");
            }
        }
    }
}
